home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / indeo_if.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-03  |  13.7 KB  |  335 lines

  1. /************************************************************************
  2. *  vfw_spec.h                                                           *
  3. *                                                                       *
  4. * This code and information is provided "as is" without warranty of     *
  5. * any kind, either expressed or implied, including but not limited to   *
  6. * the implied warranties of merchantability and/or fitness for a        *
  7. * particular purpose.                                                   *
  8. *                                                                       *
  9. *               Copyright (c) 1994-1995 Intel Corporation.              *
  10. *                         All Rights Reserved.                          *
  11. *                                                                       *
  12. ************************************************************************/
  13. /*
  14.  *
  15.  *  DESCRIPTION:
  16.  *  The Indeo(R) Video Interactive codec provides access to new features
  17.  *  using the ICM_SETCODECSTATE and ICM_GETCODECSTATE messages. This header
  18.  *  file defines the data structures used in these messages.
  19.  */
  20.  
  21. /* $Revision:   1.27  $
  22.  */
  23.  
  24.  
  25. #ifndef __VFW_SPEC_H__
  26. #define __VFW_SPEC_H__
  27.  
  28.  
  29. /* The specific interface version is defined as follows:
  30.  */
  31. #define INTERFACE_MAJOR_NUMBER(v)                       ((v) >> 16)
  32. #define INTERFACE_MINOR_NUMBER(v)                       ((v) & 0xffff)
  33. #define CREATE_INTERFACE_VERSION(maj,min)               ((((DWORD)maj)<<16) | (((DWORD)min) & 0xffff))
  34. #define SPECIFIC_INTERFACE_VERSION                      CREATE_INTERFACE_VERSION(1,2)
  35.  
  36. /* The codec specific information is handled by the general state
  37.  * handler.
  38.  */
  39. #define ICM_GETCODECSTATE                                       ICM_GETSTATE
  40. #define ICM_SETCODECSTATE                                       ICM_SETSTATE
  41. #define EXTENDED_INTERFACE_SIZE                                 1
  42.  
  43. /* OS Environments - Within the Microsoft Windows domain (Win 3.1, Win 95,
  44.  * and Win NT), both applications and codecs can be compiled in either 16 or
  45.  * 32-bit formats.  Any combination is allowed with the knowledge that data
  46.  * pointers will not be thunked.
  47.  */
  48. typedef enum {
  49.         OE_UNDEFINED,
  50.         OE_16,
  51.         OE_32,
  52. } R4_OS_ENVIRONMENT;
  53.  
  54.  
  55. /* The type field identifies the kind of operation that should be done as part
  56.  * of the ICM_GETCODECSTATE and ICM_SETCODECSTATE messages.
  57.  *
  58.  * The MT_UNDEFINED value is not a supported type - it should only be used
  59.  * to initialize variables to an "undefined" state.
  60.  */
  61. typedef enum {
  62.         MT_UNDEFINED,
  63.         MT_DECODE_FRAME_DEFAULT,
  64.         MT_DECODE_FRAME_VALUE,
  65.         MT_DECODE_SEQ_DEFAULT,
  66.         MT_DECODE_SEQ_VALUE,
  67.         MT_ENCODE_SEQ_DEFAULT,
  68.         MT_ENCODE_SEQ_VALUE,
  69.         MT_DECODE_INIT_DATA
  70. } R4_MESSAGE_TYPE;
  71.  
  72. /*
  73.  * MT_QUEUE is for 16-bit applications that call 32-bit codecs, only.  It
  74.  * is necessary to pre-set ICM_GETCODECSTATE messages by first issuing an
  75.  * ICM_SETCODECSTATE with the MT_QUEUE flag or'ed with the desired
  76.  * message type to get.  The ICM_GETCODECSTATE message which follows
  77.  * must set its dwFourCC field to 0.
  78.  */
  79. #define MT_QUEUE  (1UL<<31)
  80.  
  81. /* UCHAR is defined in Win32 but not Win16 MS* Windows headers.
  82.  */
  83. #if !defined UCHAR
  84. typedef unsigned char UCHAR;
  85. #endif
  86.  
  87. /* A flag is false if it is zero, otherwise it is true.
  88.  */
  89. typedef DWORD R4_FLAG;
  90.  
  91. /* Pointer to a Flag - A pointer to a flag is used by the codec to write
  92.  * status information at a later time.
  93.  */
  94. typedef R4_FLAG FAR * PTR_R4_FLAG;
  95.  
  96.  
  97. /* Rectangle - The following structure is used to describe a rectangle.
  98.  */
  99. typedef struct {
  100.         DWORD dwX;
  101.         DWORD dwY;
  102.         DWORD dwWidth;
  103.         DWORD dwHeight;
  104. } R4_RECT, FAR * PTR_R4_RECT;
  105.  
  106.  
  107. /* Transparency Bitmask - A transparency bitmask contains one bit for each
  108.  * pixel in the source image. If a bit is zero the data is transparent.
  109.  * The first bit in each byte is identified by the mask 0x80.  The last
  110.  * bit in each byte is identified by the mask 0x01.
  111.  *
  112.  * To allow faster access each row must begin on a DWORD boundary and the
  113.  * total number of bytes must be rounded-up to a multipe of four.
  114.  */
  115. typedef BYTE FAR * PTR_R4_BITMASK;
  116.  
  117.  
  118. /* Playback Platform - The codec supports several playback options.  This is
  119.  * not hardware specific.  Instead it rates the relative capabilities of the
  120.  * hardware.
  121.  */
  122. typedef enum {
  123.         PP_LOW,
  124.         PP_MEDIUM,
  125.         PP_HIGH,
  126. } R4_PLAYBACK_PLATFORM;
  127.  
  128.  
  129. /* Transparency Method - The codec supports a number of tranparency encoding
  130.  * methods. The enumeration specifies the transparency method.
  131.  */
  132. typedef enum {
  133.         TM_UNDEFINED,
  134.         TM_NONE,
  135.         TM_RANGE,
  136.         TM_BITMASK,
  137.         TM_FRAME,
  138.         TM_ALPHA_CHANNEL                /* XRGB color formats only */
  139. } R4_TRANS_METHOD;
  140.  
  141.  
  142. /* Transparency Range - A transparency range is specified using minimum
  143.  * and maximum values for R, G, and B. Any pixel with values within this range
  144.  * (inclusive) is considered transparent.
  145.  */
  146. typedef struct {
  147.         WORD            u16Reserved;
  148.         UCHAR           u8BlueLow;
  149.         UCHAR           u8BlueHigh;
  150.         UCHAR           u8GreenLow;
  151.         UCHAR           u8GreenHigh;
  152.         UCHAR           u8RedLow;
  153.         UCHAR           u8RedHigh;
  154. } R4_RANGE, FAR * PTR_R4_RANGE;
  155.  
  156.  
  157. /* The structure header is a set fields that are common,
  158.  * to each of the data structures that follows.
  159.  */
  160. typedef struct {
  161.         DWORD           dwSize;
  162.         DWORD           dwFourCC;
  163.         DWORD           dwVersion;
  164.         LONG            mtType;
  165.         LONG            oeEnvironment;
  166.         DWORD           dwFlags;
  167. } R4_HEADER, FAR * PTR_R4_HEADER;
  168. /* The structure header size is enough room for dwSize, dwFourCC,
  169.  * dwVersion, dwType, dwEnvironment, and dwFlags
  170.  */
  171. #define R4_STRUCTURE_HEADER_SIZE (sizeof(R4_HEADER))
  172.  
  173.  
  174. typedef enum {
  175.         OFF,
  176.         LOW,
  177.         MEDIUM,
  178.         HIGH
  179. } R4_DITHER;
  180.  
  181. /* Some decode parameters can be changed prior to either an ICM_DECOMPRESS or
  182.  * ICM_DECOMPRESSEX mesage. These are found in the  R4_DEC_FRAME_DATA
  183.  * structure.  See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  184.  */
  185. #define DECFRAME_TIME_LIMIT                     (1UL<<0)
  186. #define DECFRAME_DECODE_RECT                    (1UL<<1)
  187. #define DECFRAME_VIEW_RECT                      (1UL<<2)
  188. #define DECFRAME_BOUNDING_RECT                  (1UL<<3)
  189. #define DECFRAME_TRANS_BITMASK                  (1UL<<4)
  190. #define DECFRAME_BRIGHTNESS                     (1UL<<5)
  191. #define DECFRAME_SATURATION                     (1UL<<6)
  192. #define DECFRAME_CONTRAST                       (1UL<<7)
  193. #define DECFRAME_FILL_COLOR                     (1UL<<9)
  194. #define DECFRAME_8BIT_CONFIG_PALETTE            (1UL<<10)
  195. #define DECFRAME_8BIT_DITHER                    (1UL<<11)
  196. #define DECFRAME_VIEW_RECT_ORIGIN               (1UL<<12)
  197. #define DECFRAME_INPUT_TRANS_MASK               (1UL<<13)
  198. #define DECFRAME_VALID                          (1UL<<31)
  199.  
  200. /* Signals that the fill color provided is not a defined value */
  201. #define DECFRAME_FILL_UNDEFINED 0xFF000000
  202.  
  203. typedef struct {
  204.         DWORD           dwSize;
  205.         DWORD           dwFourCC;
  206.         DWORD           dwVersion;
  207.         LONG            mtType;
  208.         LONG            oeEnvironment;
  209.         DWORD           dwFlags;
  210.  
  211.         DWORD           dwTimeLimit;                            /* version 1.0 */
  212.         R4_RECT         rDecodeRect;                            /* version 1.0 */
  213.         R4_RECT         rViewRect;                              /* version 1.0 */
  214.         PTR_R4_RECT     prBoundingRect;                         /* version 1.0 */
  215.         PTR_R4_BITMASK  pbmTransparencyBitmask;                 /* version 1.0 */
  216.         PTR_R4_FLAG     pfUpdatedTransparencyBitmask;           /* version 1.0 */
  217.         LONG            lBrightness;                            /* version 1.0 */
  218.         LONG            lSaturation;                            /* version 1.0 */
  219.         LONG            lContrast;                              /* version 1.0 */
  220.  
  221.         DWORD           dwFillColor;                            /* version 1.2 */
  222.         DWORD           dwFirstPalIndex;                        /* version 1.2 */
  223.         DWORD           dwLastPalIndex;                         /* version 1.2 */
  224.         LPRGBQUAD       prgbPalette;                            /* version 1.2 */
  225.         R4_DITHER       eDither;                                /* version 1.2 */
  226.         R4_FLAG         fViewRectOrigin;                        /* version 1.2 */
  227.         PTR_R4_BITMASK  pbmInputTransparencyBitmask;             /* version 1.2 */
  228. } R4_DEC_FRAME_DATA, FAR * PTR_R4_DEC_FRAME_DATA;
  229.  
  230. /* Turning scalability off completely was accomplished in versions 1.0 and 1.1
  231.  * of the interface by decoding in STEPPING mode.  Setting the scalability
  232.  * flag to false meant not to drop the quality of frames, but frames could
  233.  * still be dropped.  For this reason, if SC_OFF is used, it will map to
  234.  * stepping mode, and SC_DONT_DROP_QUALITY occupies the position of "false."
  235.  */
  236. typedef enum {
  237.         SC_DONT_DROP_QUALITY,
  238.         SC_ON,
  239.         SC_DONT_DROP_FRAMES,
  240.         SC_OFF,
  241. } R4_SCALABILITY;
  242.  
  243. /* Other decode parameters can only be changed prior to either an
  244.  * ICM_DECOMPRESS_BEGIN or an ICM_DECOMPRESSEX_BEGIN message.  These
  245.  * are found in the R4_DEC_SEQ_DATA structure.
  246.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  247.  */
  248. #define DECSEQ_KEY                                      (1UL<<0)
  249. #define DECSEQ_SCALABILITY                              (1UL<<1)
  250. #define DECSEQ_FILL_TRANSPARENT                         (1UL<<2)
  251. #define DECSEQ_ALT_LINE                                 (1UL<<3)
  252. #define DECSEQ_VALID                                    (1UL<<31)
  253.  
  254. typedef struct {
  255.         DWORD           dwSize;
  256.         DWORD           dwFourCC;
  257.         DWORD           dwVersion;
  258.         LONG            mtType;
  259.         LONG            oeEnvironment;
  260.         DWORD           dwFlags;
  261.  
  262.         DWORD           dwKey;                                  /* version 1.0 */
  263.         R4_FLAG         fEnabledKey;                            /* version 1.0 */
  264.         LONG            eScalability;                           /* version 1.2; 1.0 fScalability */
  265.         R4_FLAG         fFillTransparentPixels;                 /* version 1.0 */
  266.         R4_FLAG         fAltLine;                               /* version 1.1 */
  267. } R4_DEC_SEQ_DATA, FAR * PTR_R4_DEC_SEQ_DATA;
  268.  
  269.  
  270. /* Decode persistent data parameters can only be sent prior to the
  271.  * first ICM_DECOMPRESS_BEGIN message. These are found in the
  272.  * R4_DECODE_INIT_DATA structure.
  273.  */
  274. #define DECINIT_VALID                           (3UL<<30)       /* valid bit + one other bit */
  275.  
  276. typedef struct {
  277.         DWORD           dwSize;
  278.         DWORD           dwFourCC;
  279.         DWORD           dwVersion;
  280.         LONG            mtType;
  281.         LONG            oeEnvironment;
  282.         DWORD           dwFlags;
  283.  
  284.         R4_FLAG         fBidir;                                 /* version 1.2 */
  285.         R4_FLAG         fDeltaFrames;                           /* version 1.2 */
  286.         R4_FLAG         fTransparency;                          /* version 1.2 */
  287.         DWORD           dwNLevels;                              /* version 1.2 */
  288.         DWORD           dwTileWidth;                            /* version 1.2 */
  289.         DWORD           dwTileHeight;                           /* version 1.2 */
  290. } R4_DECODE_INIT_DATA, FAR * PTR_R4_DECODE_INIT_DATA;
  291.  
  292.  
  293. /* Encode parameters can only be changed prior to an ICM_COMPRESS_BEGIN
  294.  * messsage.  These are found in the R4_ENC_SEQ_DATA structure (these
  295.  * include the parameters that can be set in the super dialog box).
  296.  * See CUSTOM_INTERFACE_ENCODER_DATA for structure size constraints.
  297.  */
  298. #define ENCSEQ_KEY                      (1UL<<0)
  299. #define ENCSEQ_MINIMUM_VIEWPORT         (1UL<<1)
  300. #define ENCSEQ_TRANSPARENCY             (1UL<<2)
  301. #define ENCSEQ_SCALABILITY              (1UL<<3)
  302. #define ENCSEQ_BI_DIR_PREDICTION        (1UL<<4)
  303. #define ENCSEQ_PLAYBACK_PLATFORM        (1UL<<5)
  304. #define ENCSEQ_RANDOM_KEY_AND_BIDIR     (1UL<<6)
  305. #define ENCSEQ_FRAME_INFO               (1UL<<7)
  306. #define ENCSEQ_QUICK_COMPRESS           (1UL<<8)
  307. #define ENCSEQ_VALID                    (1UL<<31)
  308.  
  309. typedef struct {
  310.         DWORD           dwSize;
  311.         DWORD           dwFourCC;
  312.         DWORD           dwVersion;
  313.         LONG            mtType;
  314.         LONG            oeEnvironment;
  315.         DWORD           dwFlags;
  316.  
  317.         DWORD           dwKey;                                  /* version 1.0 */
  318.         DWORD           dwMinViewportWidth;                     /* version 1.0 */
  319.         DWORD           dwMinViewportHeight;                    /* version 1.0 */
  320.         R4_RANGE        rngTransparencyRange;                   /* version 1.0 */
  321.         PTR_R4_BITMASK  pbmTransparencyBitmask;                 /* version 1.0 */
  322.         LONG            tmTransparencyMethod;                   /* version 1.0 */
  323.         R4_FLAG         fEnabledKey;                            /* version 1.0 */
  324.         R4_FLAG         fScalability;                           /* version 1.0 */
  325.         R4_FLAG         fBiDirPrediction;                       /* version 1.0 */
  326.         R4_FLAG         fRandomKeyAndBiDir;                     /* version 1.0 */
  327.         DWORD           dwPlaybackPlatform;                     /* version 1.0 */
  328.         WORD            wFrameLatency;                          /* version 1.0 */
  329.         WORD            wDeadFrames;                            /* version 1.0 */
  330.         R4_FLAG         fQuickCompress;                         /* version 1.1 */
  331. } R4_ENC_SEQ_DATA, FAR * PTR_R4_ENC_SEQ_DATA;
  332.  
  333.  
  334. #endif /* __VFW_SPEC_H__ */
  335.